package com.hujiang.basic.search.model;

import java.io.Serializable;
import java.util.List;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class HJSearchRequest extends HJEsRequest {

    private static final long serialVersionUID = 1L;

    private Integer from = 0;
    private Integer size = 10;

    /**
     * 返回展示字段field1,fields2
     */
    private List<String> fields;

    /**
     * 排序字段  多字段排序的支持
     */
    private JSONArray sort;

   /*
   * 聚合字段：支持terms aggregations，order by doc_count,range aggregation
   * */
    private JSONObject aggs;

    /**
     * 重打分机制，基于沪江现有的场景支持script二次算分
     */
    private JSONObject rescore;

    /**
     * 查询字段
     */
    private JSONObject query;

    /*
    * 高亮字段
     *  */
    private JSONObject highlight;

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        else if (null!=obj && this.getClass() != obj.getClass()) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        return this.hashCode();
    }

}
